package com.ferenc.springboot.mybatis;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.io.ClassPathResource;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

/**
 * TODO
 *
 * @author <a href="mailto:ferenc.zeng@gmail.com">Ferenc Zeng</a>
 * @since 2022-02-17
 */
@SpringBootApplication
public class MybatisApplication {

    public static void main(String[] args) throws IOException {

        SpringApplication.run(MybatisApplication.class, args);

//
//        ClassPathResource resource = new ClassPathResource("scripts/db");
//
//        File dir = resource.getFile();
//
//        File[] files = dir.listFiles();
//        for(File file : files) {
//            System.out.println(file.getAbsolutePath());
//            BufferedReader in = new BufferedReader(new FileReader(file));
//            String str ;
//            while ((str = in.readLine()) != null) {
//                System.out.println(str);
//            }
//        }

//        String[] list = file.list();
//
//        for (String name : list) {
//
//            File file = new ClassPathResource("scripts/db" + File.separator + name).getFile();
//
//            System.out.println(path);
//        }


    }
}
